#ifndef DATABOARD_H
#define DATABOARD_H

#include <QtGui/QWidget>
#include "enumtypes.h"

class BinaryFile;
class BinaryDataFormatUI;
class TextFile;
class UnknownFile;
class FileGroup;
class TreeView;

class QStandardItemModel;
class QModelIndex;
class QTreeView;
class QVBoxLayout;

namespace Ui
{
    class DataBoard;
}

class DataBoard : public QWidget
{
    Q_OBJECT

public:
    DataBoard(QWidget *parent = 0);
    ~DataBoard();

protected:
    void changeEvent(QEvent *e);

protected slots:
    void switchTreeViewFileType(QString fileType);
    void switchGroupBoxSummary(const QModelIndex &index);
    void modityDataFormat();
    void saveDataFormat();
    void addNewFiles(const QStringList &filePathes);
    void showData(const QModelIndex &index);
    void deleteFile(const QModelIndex &index);

private:
    Ui::DataBoard *m_ui;

    BinaryDataFormatUI *binaryDataFormatUI;
    int currentDataFormatUIIndex;

    QMap<QString, EnumTypes::FileType> *fileSuffixTypeMap;

    QList<BinaryFile *> *binaryFileList;
    QList<FileGroup *> *binaryFileGroupList;
    QStandardItemModel *binaryFileGroupModel;
    TreeView *treeView_binaryFileList;
    QList<TextFile *> *textFileList;
    QList<FileGroup *> *textFileGroupList;
    QStandardItemModel *textFileGroupModel;
    QTreeView *treeView_textFileList;
    QList<UnknownFile *> *unknownFileList;
    QList<FileGroup *> *unknownFileGroupList;
    QStandardItemModel *unknownFileGroupModel;
    QTreeView *treeView_unknownFileList;
};

#endif // DATABOARD_H
